package com.fandy.struts.DAL;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.fandy.struts.SqlAccess.SqlServerHelper;
import com.fandy.struts.SqlStatement.Stock;


public class DALStock {

	Stock s = new Stock();
 SqlServerHelper ssh = new SqlServerHelper();

	public   ResultSet  getAll()
	{
		return    ssh.executeScalar(s.getAll());
	}
	
	public   ResultSet getStockInfoByDepID(int DepID)
	{
		return ssh.executeScalar(s.getStockInfoByDepID(DepID));
	}
	
	public   ResultSet getStockInfoByGoodsID(int GoodsID)
	{
		return ssh.executeScalar(s.getStockInfoByGoodID(GoodsID));
	}
	
	
	public   ResultSet  existStock(com.fandy.struts.Model.Stock stk)
	{
		return   ssh.executeScalar(s.existStock(stk));
	}
	
	public int UpdateByID(int oldDepid,int oldGoodID ,com.fandy.struts.Model.Stock stk) throws SQLException
	{
		
		return  ssh.executeNoQuery(s.UpdateByID(oldDepid, oldGoodID, stk));
	}
	
	public int DeleteByID(int depId,int GoodsID) throws SQLException
	{
		
		return ssh.executeNoQuery(s.DeleteByID(depId, GoodsID));
		
	}
	
	
	
}

